Skip to content

feat(sedona-gdal): add high-level safe GDAL API wrappers#682

Draft
Kontinuation wants to merge 5 commits intoapache:mainfrom
Kontinuation:feat/sedona-gdal-safe
Draft

feat(sedona-gdal): add high-level safe GDAL API wrappers#682
Kontinuation wants to merge 5 commits intoapache:mainfrom
Kontinuation:feat/sedona-gdal-safe

Conversation

@Kontinuation
Copy link
Member

@Kontinuation Kontinuation commented Mar 3, 2026

Summary

  • Add safe Rust wrappers on top of the dynamically loaded GDAL bindings from feat(c/sedona-gdal): add crate with dynamically loaded GDAL bindings #681.
  • Includes: Dataset, Driver/DriverManager, RasterBand, SpatialRef, Geometry, Feature, Layer, VRT dataset builder, VSI virtual filesystem, rasterize, rasterize_affine, polygonize, GeoTransform, CslStringList, MemDatasetBuilder, and supporting types.
  • APIs use the georust/gdal v0.19.0 crate as a reference (see file-level doc comments for attribution). We only implemented the code we actually need for now. We'll extend these high-level APIs as we implement more RS functions.

Depends on #681.

Add the sedona-gdal crate providing runtime-loaded GDAL FFI bindings
via libloading. This includes the SedonaGdalApi function-pointer struct,
dynamic symbol loading, the GdalApi handle with call_gdal_api! macro,
error types, and global API registration.
- Introduce GdalApiBuilder with lazy initialization pattern (similar to
  sedona-proj's ProjCrsEngineBuilder): configure_global_gdal_api now
  stores a builder in a Mutex, and get_global_gdal_api builds the API
  on first access. This allows callers to override configuration before
  the first GDAL operation.
- Add compile_error! for unsupported platforms (non-unix, non-windows)
  in current_process_library.
- Add 9 unit tests covering loading errors, symbol loading, builder
  configuration, and global API access.
@Kontinuation Kontinuation force-pushed the feat/sedona-gdal-safe branch from fcdfb41 to 72b2e7e Compare March 5, 2026 07:27
Add safe Rust wrappers on top of the dynamically loaded GDAL bindings:
Dataset, Driver, RasterBand, SpatialRef, Geometry, Feature, Layer, VRT,
VSI, rasterize, polygonize, and supporting types. These APIs use the
georust/gdal v0.19.0 crate as a reference (see file-level doc comments
for attribution).
@Kontinuation Kontinuation force-pushed the feat/sedona-gdal-safe branch from 72b2e7e to 2c0cbd8 Compare March 5, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant